<div class="bjui-pageHeader">
    <div class="pull-right">
        <button class="btn-default" data-icon="refresh" onclick="$.CurrentNavtab.navtab('refresh')"></button>
    </div>
</div>
<div class="bjui-pageContent">
    <form action="{:U('save_distr')}" data-toggle="validate" data-alertmsg="false" class="navtabForm">
        <div class="form-group">
            <label class="x100">分销开关:</label>
            <input type="radio" name="distr_status" value="0" id="distr-status1" data-toggle="icheck" data-label="开启" <if condition="$va.distr_status neq '1'"> checked</if>  />
            <input type="radio" name="distr_status" value="1" id="distr-status2" data-toggle="icheck" data-label="关闭"  <if condition="$va.distr_status eq '1'"> checked</if> />
        </div>
        <div class="form-group">
            <label class="x100">成为分销商:</label>
            <input type="radio" name="distr_factor" value="1" id="distr-factor1" data-toggle="icheck" data-label="直接成为分销商"  <if condition="$va.distr_factor eq '1' or $va.distr_factor eq null">checked</if>  />
            <input type="radio" name="distr_factor" value="2" id="distr-factor2" data-toggle="icheck" data-label="成功购买商品后"  <if condition="$va.distr_factor eq '2'">checked</if> />
            <input type="radio" name="distr_factor" value="3" id="distr-factor3" data-toggle="icheck" data-label="手动添加"   <if condition="$va.distr_factor eq '3'">checked</if>/>
        </div>
        <div class="form-group">
            <label class="x100">分销名称:</label>
            <input type="text" name="distr_name" value="{$va.distr_name}" data-rule="required" />
        </div>
        <div class="form-group">
            <label class="x100">分销模式:</label>
            <select name="distr_type" class="order-type" data-toggle="selectpicker">
                <option value="1" <if condition="$va.distr_type neq '2'">selected</if>>按订单设置分成</option>
                <option value="2" <if condition="$va.distr_type eq '2'">selected</if>>按商品设置分成</option>
            </select>
        </div>
        <div class="form-group order-bili" <if condition="$va.distr_type eq '2'">style="display:none"</if>>
            <label class="x100">订单分成比例:</label>
            <input type="text" name="distr_order_sale"  class="w60" value="{$va.distr_order_sale}"/> %
            <span class="text-warning">订单总额百分比拿来分成</span>
        </div>
        <div class="form-group">
            <label class="x100">一级分销商名称:</label>
            <input type="text" name="distr_one_name" data-rule="required" value="{$va.distr_one_name}"/>
        </div>
        <div class="form-group">
            <label class="x100">一级分销比例:</label>
            <input type="text" name="distr_one_sale" data-rule="required;digits" class="w60" value="{$va.distr_one_sale}"/> %
        </div>
        <div class="form-group">
            <label class="x100">二级分销商名称:</label>
            <input type="text" name="distr_two_name" value="{$va.distr_two_name}"/>
        </div>
        <div class="form-group">
            <label class="x100">二级分销比例:</label>
            <input type="text" name="distr_two_sale" value="{$va.distr_two_sale}" class="w60" /> %
        </div>
        <div class="form-group">
            <label class="x100">三级分销商名称:</label>
            <input type="text" name="distr_three_name" value="{$va.distr_three_name}" />
        </div>
        <div class="form-group">
            <label class="x100">三级分销比例:</label>
            <input type="text" name="distr_three_sale" value="{$va.distr_three_sale}" class="w60" /> %
        </div>
        <div class="form-group">
            <label class="x100">分成时间:</label>
           <!--  <input type="radio" name="distr_factor" value="1" id="distr-factor1" data-toggle="icheck" data-label="付完款后就分成"  checked  />
            <input type="radio" name="distr_factor" value="2" id="distr-factor2" data-toggle="icheck" data-label="收货后分成"   /> -->
            <input type="text" name="distr_time" data-rule="required;digits" class="w60" value="{$va.distr_time}"/> 天
            <span class="text-warning">订单收货后多少天可以分成</span> 
        </div>
         <div class="form-group">
             <label class="x100">满多少才能提现:</label>
             <input type="text" name="max_money" data-rule="required;digits" value="{$va.max_money}"class="w100" /> 元
         </div>
        <div class="form-group">
            <label class="x100">最少提现额度:</label>
            <input type="text" name="nim_money" data-rule="required;digits" value="{$va.nim_money}" class="w100" /> 元
        </div>
    </form>
</div>
<script>
    $(function () {
        $('.order-type').change(function (e) {
            if ( $(this).val() == 1 ) {
                $('.order-bili').show();
            }else {
                $('.order-bili').hide();
            }
        });
    });
</script>
<include file="Common/footer" ftype="save"/>